﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HighDivePrinter.Model;
using HighDivePrinter.View;

namespace HighDivePrinter.Presenter
{
     public class PresenterFormJudge
     {

         #region Fields/Variables
         #endregion

         #region Properties
         public IFormJudge _viewJudge { get; set; }
         public IJudgeList _judge { get; set; }

         #endregion

         #region Constructor
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="view"></param>
        /// <param name="cr"></param>
        /// 
        public PresenterFormJudge(IFormJudge viewJudge, JudgeList jl)
        {
            //Judge Class
            this._judge = jl;
            this._viewJudge = viewJudge;
            this._viewJudge.SetJudgeList(jl.ListJudge);
            this._viewJudge.EventAddJudgeList += AddJudge;
            this._viewJudge.EventRemoveJudgeList += RemoveJudge;
            this._viewJudge.EventSaveJudgeList += SaveJudge;
            this._viewJudge.EventReadJudgeList += ReadJudge;
          }

        #endregion

        //Contest class

        public void AddJudge()
        {
            this._judge.AddJudgeList(new Judge());
        }

        public void RemoveJudge(int index)
        {
            this._judge.RemoveJudgeList(index);
        }

        public void SaveJudge()
        {
            this._judge.SaveJudgeList();
        }

        public void ReadJudge()
        {
            this._judge.ReadJudgeList();
        }
     }
}
